CREATE TABLE jms_dm.dm_start_center_violate_cnt_dt (
 agent_code varchar(50) NULL COMMENT "代理区：发件网点代理区",
 center_code varchar(50) NULL COMMENT "转运中心：始发中心发件网点code",
 date_time date NULL COMMENT "查询日期",
 center_name varchar(120) NULL COMMENT "转运中心：始发中心发件网点name",
 agent_name varchar(120) NULL COMMENT "代理区名称",
 not_should_bag_cnt int(11) NULL COMMENT "不应建包数",
 violate_cnt int(11) NULL COMMENT "违规建包票数",
 weight_violate_cnt int(11) NULL COMMENT "重量违规票数",
 side_violate_cnt int(11) NULL COMMENT "边长违规票数",
 flow_violate_cnt int(11) NULL COMMENT "单流向数量违规票数",
 scan_time date NULL COMMENT "发件日期"
) ENGINE=OLAP 
DUPLICATE KEY(agent_code, center_code)
COMMENT "(始发)中心违规建包汇总"
PARTITION BY RANGE (date_time) ( 
   START ("2023-01-01") END ("2023-01-15") EVERY (INTERVAL 1 day))
DISTRIBUTED BY HASH(center_code) BUCKETS 2 
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-365",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "2",
"in_memory" = "false",
"storage_format" = "V2"
);